package Application.serviceImpl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import Application.dao.AttentionDao;
import Application.entity.Attention;
import Application.entity.Result;
import Application.service.AttentionService;
@Service("AttentionService")
public class AttentionServiceImpl implements AttentionService {

	@Resource
	private AttentionDao dao;
	
	@Override
	public Result addAttention(Attention attention) {
		Result r = new Result();
		try {
			dao.addAttention(attention);
			r.setContent(1);
		} catch (Exception e) {
			r.setContent(0);
		}
		return r;
	}

	@Override
	public Result removeAttention(int id) {
		Result r = new Result();
		try {
			dao.removeAttention(id);
			r.setContent(1);
		} catch (Exception e) {
			r.setContent(0);
		}
		return r;
	}

	@Override
	public List<Attention> findUserAttention(int id) {
		return dao.findUserAttention(id);
	}

}
